﻿using System;
using System.Collections.Generic;
using System.Collections;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Data;
using System.Globalization;
using System.Windows.Forms;

namespace Foliatura
{
    public class Controller : System.Windows.Forms.ApplicationContext
    {
        private static volatile Controller _instance = null;
        public BussinesLogic.Usuario user;
        public BussinesLogic.Expediente expediente;
        public BussinesLogic.Portada portada;
        public BussinesLogic.Documento documento;
        public ArrayList expedientes;
        public ArrayList documentos;
        public string FormatoFecha = "dd-MM-yyyy";
        public DateTimeFormatInfo FormatInfo = DateTimeFormatInfo.InvariantInfo;
        public string SafeFileName;
        //public 
        
    /// <summary>
    /// The static method to provide global access to the singleton object.
    /// </summary>
    /// <returns>Singleton object of class Singleton.</returns>
        public static Controller Instance()
        {
            if (_instance == null)
            {
                lock (typeof(Controller))
                {
                    _instance = new Controller();
                }
            }
            return _instance;
        }

    /// <summary>
    /// The constructor is defined private in nature to restrict access.
    /// </summary>
        private Controller() 
        {
            
            
        }

        public static void muestraLogin()
        {
            new LogIn().Show();
            
        }

        public void ApplicationClose()
        {
            Application.Exit();
        }


        public static void CambiarPantalla( System.Windows.Forms.Form form1, System.Windows.Forms.Form form2)
        {
            form1.Close();
            form2.Show();            
                        
        }
    }
    
}

